import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '合同编号',
    align: "center", resizable: true,
    dataIndex: 'contractNo'
  },
  {
    title: '创建时间',
    align: "center", resizable: true,
    dataIndex: 'createTime'
  },
   {
    title: '合同名称',
    align: "center", resizable: true,
    dataIndex: 'name'
  },
  
  {
    title: '项目',
    align: "center", resizable: true,
    dataIndex: 'projectId_dictText'
  },
  {
    title: '子项目',
    align: "center", resizable: true,
    dataIndex: 'subProjectId_dictText'
  },
  {
    title: '分包商',
    align: "center", resizable: true,
    dataIndex: 'contactId_dictText'
  },
  {
    title: '总包主体',
    align: "center", resizable: true,
    dataIndex: 'companyInfoId_dictText'
  },
  {
    title: '合同金额',
    align: "center", resizable: true,
    dataIndex: 'contractAmount'
  },
  {
    title: '含税价',
    align: "center", resizable: true,
    dataIndex: 'taxIncludingPrice'
  },
  {
    title: '质保金(含税)',
    align: "center", resizable: true,
      dataIndex: 'warrantyPrice'
  },
  {
    title: '合同日期',
    align: "center", resizable: true,
    dataIndex: 'contractDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '合同文件',
    align: "center", resizable: true,
    dataIndex: 'contractFile',
  },
];

// 高级查询数据
export const superQuerySchema = {
  contractNo: {title: '合同编号',order: 0,view: 'text', type: 'string',},
  projectId: {title: '项目',order: 1,view: 'list', type: 'string',dictTable: "c_project_application", dictCode: 'id', dictText: 'project_name',},
  subProjectId: {title: '子项目',order: 2,view: 'list', type: 'string',dictTable: "c_sub_project", dictCode: 'id', dictText: 'sub_project_name',},
  contractAmount: {title: '合同金额',order: 3,view: 'number', type: 'number',},
  contractDate: {title: '合同日期',order: 4,view: 'date', type: 'string',},
  contractFile: {title: '合同文件',order: 5,view: 'file', type: 'string',},
};
